<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
    <title></title>
    <link rel="stylesheet" href="css/layer.css" />
    <link rel="stylesheet" href="css/style.css" />
    <link rel="stylesheet" href="css/iconfont.css" />
	<link rel="icon" href="images/favicon.png">
</head>
<body>
	<div  id="team">
		<div class="team_top">
			<div class="team_sz">
				<span class="num_team">聚商优品</span>
				<a href="#" onclick="install()">
					<span class="sz_img"><img src="images/sz.png"/></span>
				</a>
			</div>
			<div class="team_center">
				<dl class="left_dl">
					<dt class="left_dt">
						<img src="images/person.png"/>
					</dt>
					<dd class="left_dd" id="userName"></dd>
				</dl>
				<!--<dl class="right_dl">
					<dt class="right_dt">推荐码&nbsp;：</dt>
					<dd class="right_dd" id="promoCode"></dd>
				</dl>-->
			</div>
			<div class="team_tit">
				<p class="vip_tit" id="identityName"></p>
				<p class="vip_id"><span class="id_span" id="mobileNumber"></span></p>
			</div>
		</div>
		<!--公告-->
		<div class="notice">
			<div class="notice_div">
				<span class="notice_img">
					<img src="images/ld.png"/>
				</span>
				<span class="notice_img gg">
					<img src="images/gg.png"/>
				</span>
				<div id="scroll_div" class="fl">
					<div id="scroll_begin">
						<span class="pad_right"></span>
					</div>
					<div id="scroll_end"></div>
				</div>
			</div>
		</div>
		<!--四大模块-->
		<div class="team_fouce">
			<div class="fouce_div">
				<dl class="fouce_dl" onclick="register()">
					<dt class="fouce_dt">帮助注册</dt>
					<dd class="fouce_dd">
						<img src="images/zc.png"/>
					</dd>
				</dl>
				<dl class="fouce_dl two_dl">
					<a onclick="apply()">
						<dt class="fouce_dt">申请升级</dt>
						<dd class="fouce_dd">
							<img src="images/sq.png"/>
						</dd>
					</a>
				</dl>
				<dl class="fouce_dl three_dl" >
					<a onclick="Auditing()">
						<dt class="fouce_dt">审核升级</dt>
						<dd class="fouce_dd">
							<img src="images/sh.png"/>
						</dd>
					</a>
				</dl>
				<dl class="fouce_dl last_dl">
					<a onclick="team()">
						<dt class="fouce_dt">我的团队</dt>
						<dd class="fouce_dd">
							<img src="images/my.png"/>
						</dd>
					</a>
				</dl>
			</div>
		</div>
		<div class="foot">
			<p class="foot_op">客服QQ：<span class="op_name">2325760763</span></p>
			<p class="foot_op">客服QQ：<span class="op_name">2907917811</span></p>
			<p class="foot_op">客服微信：<span class="op_name">wxid_64j89wrvk4nb22</span></p>
			<!--<p class="foot_op">咨询：<span class="op_name"></span></p>-->
		</div>
		<!--底部-->
		<footer class="footer">
			<dl class="footer_dl active" onclick="index()">
				<dt class="footer_dt iconfont icon-shouye"></dt>
				<dd class="footer_dd">首页</dd>
			</dl>
			<dl class="footer_dl" onclick="register()">
				<dt class="footer_dt iconfont icon-zhuce"></dt>
				<dd class="footer_dd">帮助注册</dd>
			</dl>
			<dl class="footer_dl" onclick="apply()">
				<dt class="footer_dt iconfont icon-shenqing"></dt>
				<dd class="footer_dd">申请升级</dd>
			</dl>
			<dl class="footer_dl" onclick="Auditing()">
				<dt class="footer_dt iconfont icon-shenhe"></dt>
				<dd class="footer_dd">审核升级</dd>
			</dl>
			<dl class="footer_dl" onclick="team()">
				<dt class="footer_dt iconfont icon-wodetuandui"></dt>
				<dd class="footer_dd">我的团队</dd>
			</dl>
		</footer>
	</div>
</body>
<script type="text/javascript" src="js/jquery.js" ></script>
<script type="text/javascript" src="js/layer.js" ></script>
<script type="text/javascript">
    //文字横向滚动


	autodivheight();
	function autodivheight() { //函数：获取尺寸  
		//获取浏览器窗口高度  
		var winHeight = 0;
		if(window.innerHeight) {
			winHeight = window.innerHeight;
		} else if((document.body) && (document.body.clientHeight)) {
			winHeight = document.body.clientHeight;
			//通过深入Document内部对body进行检测，获取浏览器窗口高度  
		}
		if(document.documentElement && document.documentElement.clientHeight) {
			winHeight = document.documentElement.clientHeight;
			//DIV高度为浏览器窗口的高度  
			document.getElementById("team").style.height = winHeight - 70 + "px";
		}
	}
	window.onresize = autodivheight; //浏览器窗口发生变化时同时变化DIV高度
	var idName, nextName;
	var identityCode=0;
	//获取用户信息
	$(function () {
        var storage=window.localStorage;
        var token=storage.token;
        if(token==undefined){
            window.location.href = "/"
		}
        $.ajax({
            type: "POST",
            url: "/users/profile?token="+token,
            contentType: "application/json;charset=UTF-8",
            dataType: "json",
            success: function (data) {
                if (data.code && data.code==='success') {
                    $("#userName").html(data.data.userName);
                    $("#mobileNumber").html(data.data.mobileNumber);
                    $("#identityName").html(data.data.identityName);
					storage.idName = data.data.identityName;
					storage.nextName = data.data.nextIdentityName;
                    identityCode = data.data.identityCode;
                } else {
                    layer.msg(data.message+"，请重试",{icon:2,time:1000});
                }
            },
            error: function (data) {
                if(data.code==undefined){
                    layer.msg("登录失效",{icon:2,time:1000});
                    window.location.href ="/";
				}
                layer.msg(data.message,{icon:2,time:1000});
            }
        });
        $.ajax({
            type: "POST",
            url: "/notice/newNotice?token="+token,
            contentType: "application/json;charset=UTF-8",
            dataType: "json",
            success: function (data) {
                if (data.code && data.code==='success') {
                    $(".pad_right").html(data.data.noticeContent);
					ScrollImgLeft();
                } else {
                    layer.msg(data.message+"，请重试",{icon:2,time:1000});
                }
            },
            error: function (data) {
                if(data.code==undefined){
                    layer.msg("登录失效",{icon:2,time:1000});
                    window.location.href ="/";
                }
                layer.msg(data.message+"，请重试",{icon:2,time:1000});
            }
        });
    })
    function ScrollImgLeft(){
        var speed=50;//初始化速度 也就是字体的整体滚动速度
        var MyMar = null;//初始化一个变量为空 用来存放获取到的文本内容
        var scroll_begin = document.getElementById("scroll_begin");//获取滚动的开头id
        var scroll_end = document.getElementById("scroll_end");//获取滚动的结束id
        var scroll_div = document.getElementById("scroll_div");//获取整体的开头id
        scroll_end.innerHTML=scroll_begin.innerHTML;//滚动的是html内部的内容,原生知识!
        //定义一个方法
        function Marquee(){
            if(scroll_end.offsetWidth-scroll_div.scrollLeft<=0)
                scroll_div.scrollLeft-=scroll_begin.offsetWidth;
            else
                scroll_div.scrollLeft++;
        }
        MyMar=setInterval(Marquee,speed);//给上面的方法设置时间  setInterval
        //鼠标点击这条公告栏的时候,清除上面的方法,让公告栏暂停
        scroll_div.onmouseover = function(){
            clearInterval(MyMar);
        }
        //鼠标点击其他地方的时候,公告栏继续运动
        scroll_div.onmouseout = function(){
            MyMar = setInterval(Marquee,speed);
        }
    }
	//首页
    function index(){
        window.location.href ="/index";
    }
    //帮助注册
	function register(){

	    if(identityCode>0){
            window.location.href ="/register";
		}else{
            layer.msg('必须是一钻用户才可帮别人注册', {
                time:2000
            });
		}
	}
    //设置
    function install(){
        window.location.href ="/install";
    }
    //申请升级
    function apply(){
        window.location.href ="/apply";
    }
    //审核升级
    function Auditing(){
        window.location.href ="/Auditing";
    }
    //审核升级
    function team(){

        window.location.href ="/team";
    }

</script>
</html>